Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Creating Geometric Shapes


GXNewLine

You can use the GXNewLine function to create a new line shape and initialize its geometry.

gxShape GXNewLine(const gxLine *data);
data
A pointer to the initial line geometry.
function result
A reference to the new line shape.
DESCRIPTION
The GXNewLine function creates a copy of the default line shape, sets the owner count of the copy to 1, initializes its geometry with the values in the data parameter, and returns a reference to it as the function result.

Although this function creates a copy of the default line shape, it does not create a copy of the default line's style, ink, or transform objects. The new line shape returned by this function contains references to same style, ink, and transform as the default line shape.

SPECIAL CONSIDERATIONS
If no error occurs, the GXNewLine function creates a shape; you are responsible for disposing of this shape when you no longer need it. See Inside Macintosh: QuickDraw GX Objects for information about creating and disposing of shapes.

If an error occurs, this function returns nil as the function result.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
parameter_is_nil(debugging version)
SEE ALSO
For an example that uses this function, see "Creating and Drawing Lines" beginning on page 2-36.

For a discussion of lines and the default line shape, see "Line Shapes" on page 2-17.

For a description of the gxLine structure, see page 2-105.

To create a new line shape without specifying an initial geometry, see the description of the GXNewShape function in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.

To set the geometry of an existing line shape, see the description of the GXSetLine function on page 2-124.

To draw a line geometry without creating a line shape, see the description of GXDrawLine on page 2-158. To draw a line shape, see the description of GXDrawShape in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help